/**
 1、不设置分数上限，可以一直挑战。
 2、每接到6个水果，难度自动提高
 3、难度等级3000ms 2000ms 1500ms 1000ms 800ms 500ms

 3000ms * 6
 2000ms * 8
 1500ms * 10
 1000ms * 12
 800ms * 14
 500ms * 无穷
 */


const MAX_TIME = 600
const n = 8

const LEVEL_SCORE_LEVEL = [
  {
    n,
    time: 3000
  },
  {
    n,
    time: 2000
  },
  {
    n,
    time: 1500
  },
  {
    n,
    time: 1000
  },
  {
    n,
    time: 800
  },
  {
    n,
    time: MAX_TIME
  }
]

let _levellist = []
export const initLevel = () => {
  _levellist = []
  for (const item of LEVEL_SCORE_LEVEL) {
    for (let i = 0; i < item.n; i++) {
      _levellist.push(item.time)
    }
    _levellist.push(0)
  }
  _levellist.pop()
  // console.log(_levellist)
}

export const nextLevelTime = () => {
  return _levellist.length ? _levellist.shift() : MAX_TIME
}